import { stringify } from 'qs';
import request from '../utils/request';

/**
 * VRegion
 */
export async function queryVRegions(params) {
  return request(`/api/v1/vregions?${stringify(params)}`);
  // return request(`/api/vregions?${stringify(params)}`);
}

export async function removeVRegion(params) {
  return request(`/api/v1/vregions/${params}`, {
    method: 'DELETE',
  });
}

export async function createVRegion(params) {
  return request('/api/v1/vregions', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function updateVRegion(params) {
  const { id, ...data } = params;
  return request(`/api/v1/vregions/${id}`, {
    method: 'PATCH',
    body: {
      ...data,
    },
  });
}
